<template>
	<div :class="$hasEditPermission('/BHView') ? '' : 'maskDisabled1'">
		<div class="tabs-cps-view" :class="$hasEditPermission('/BHView') ? '' : 'maskDisabled2'">
			<div class="add-view" style="height: 45px;">
				<el-button size="small" v-show="$hasEditPermission('/BHView') && activeBtn == 0" @click="FILTERFn">
					休止中測定点の復旧
				</el-button>

				<div v-show="activeBtn == 0">
					<el-button size="small" @click="ADD(true)" v-show="$hasEditPermission('/BHView')"
						:style="{ background: initType == 1 ? '#bc000f' : '', color: initType == 1 ? 'white' : '', borderColor: initType == 1 ? '#bc000f' : '' }"
						:type="initType == 1 ? '' : 'default'" :disabled="delFlg">
						{{ $t("message.bhView.topBtnDownList.addition") }}

					</el-button>
					<el-button size="small" @click="delThckStyleApi" v-show="$hasEditPermission('/BHView')"
						:style="{ background: delFlg ? '#bc000f' : '', color: delFlg ? 'white' : '', borderColor: delFlg ? '#bc000f' : '' }"
						:disabled="initType == 1 || noDataFlg">
						{{ $t("message.bhView.topBtnDownList.delete") }}
					</el-button>
				</div>
			</div>
			<div class="row" v-show="activeBtn == 0">
				<div class="item">
					<div class="label">建設年月</div>
					<el-select v-if="initType == 2" v-model="chgDateSelectKey" class="ipt orange" placeholder=" "
						@change="selectChgDateOption">
						<el-option v-for="(item, index) in comboxList.chgDate" :key="index" :label="item.label"
							:value="item.label">
						</el-option>
					</el-select>
					<el-date-picker v-model="chgDateSelectKey" v-if="initType == 1" class="ipt orange" placeholder=" "
						:clearable="false" :format="timeFormat" :value-format="timeFormat">
					</el-date-picker>
				</div>
			</div>
			<!-- 
	1.有数据，永不加遮罩
	2.无数据，并且type加遮罩
 -->
			<div :class="btnClickFlg ? 'maskDisabled1' : ''">
				<div class="tabs-cps-view" :class="btnClickFlg ? 'maskDisabled2' : ''">

					<div v-show="activeBtn == 0">
						<div class="row">
							<div class="item">
								<div class="label">定点名称</div>
								<div class="flex-ipt-view">
									<el-input v-model="resultData.ttpPosOrdr" class="ipt orange mini-ipt"
										@input="resultData.ttpPosOrdr = $setMyNum(resultData.ttpPosOrdr, '3 - 0')"></el-input>

									<el-input v-model="resultData.posName" class="ipt orange small-ipt"
										@input="resultData.posName = $setMaxLength(resultData.posName, 20)"></el-input>
								</div>
							</div>
							<div class="item">
								<div class="label">利用状況</div>
								<div class="radio-view">
									<el-radio v-model="resultData.useCase" label="1">運用中</el-radio>
									<el-radio v-model="resultData.useCase" label="2">休止中</el-radio>
								</div>
							</div>
						</div>

						<div class="row" style="border-bottom: 1px solid #d9d9d9; margin-bottom: 12px">
							<div class="item">
								<div class="label">グループNo.</div>
								<div class="flex-ipt-view">
									<!-- ttpPosOrdr -->
									<el-input :value="TTP" class="ipt yellow mini-ipt" readonly></el-input>

									<!-- ======================= -->
									<el-select v-model="resultData.ttgPosOrdr" class="ipt  small-ipt mini-ipt77"
										placeholder=" " style="margin: 0 0px 0 0px;">
										<el-option v-for="(item, index) in comboxList.thckGrp" :key="index"
											:label="item.label" :value="item.ordr">
										</el-option>
									</el-select>
									<div class="">
										<button class="transparent-btn" @click="LIEF1 = true">編集</button>
									</div>
								</div>
							</div>
							<div class="item">
								<div class="label">実施時期</div>
								<el-select v-model="resultData.thkOpeCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.thckOpe" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item" v-if="comboxList.txtLabel[0]">
								<div class="label">{{ comboxList.txtLabel[0] }}</div>
								<div class="ipt-flex-message" style="width: 216px">
									<el-input v-model="resultData.orgThck" class="small-ipt orange mini-ipt74"
										@input="resultData.orgThck = $setMyNum(resultData.orgThck, '4 - 2')"></el-input>

									<span class="mgl8">[mm]</span>
								</div>
							</div>
							<div class="item">
								<div class="label">材質分類</div>
								<el-select v-model="resultData.mtrClsCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.mtrClsName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item" v-if="comboxList.txtLabel[1]">
								<div class="label">{{ comboxList.txtLabel[1] }}</div>
								<div class="ipt-flex-message" style="width: 216px">
									<el-input v-model="resultData.mgtThck" class="small-ipt orange mini-ipt74"
										@input="resultData.mgtThck = $setMyNum(resultData.mgtThck, '4 - 2')"></el-input>

									<span class="mgl8">[mm]</span>
								</div>
							</div>
							<div class="item">
								<div class="label">材質名称</div>
								<el-input v-model="resultData.mtrName" class="ipt " placeholder=" "
									@input="resultData.mtrName = $setMaxLength(resultData.mtrName, 40)"></el-input>

							</div>
						</div>

						<div class="row">
							<div class="item" v-if="comboxList.txtLabel[2]">
								<div class="label">{{ comboxList.txtLabel[2] }}</div>
								<div class="ipt-flex-message" style="width: 216px">
									<el-input v-model="resultData.lmtThck" class="small-ipt  mini-ipt74"
										@input="resultData.lmtThck = $setMyNum(resultData.lmtThck, '4 - 2')"></el-input>

									<span class="mgl8">[mm]</span>
								</div>
							</div>
							<div class="item">
								<div class="label">サイズ</div>
								<el-select v-model="resultData.sizCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.sizeName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row" style="border-bottom: 1px solid #d9d9d9; margin-bottom: 12px">
							<div class="item" v-if="comboxList.txtLabel[3]">
								<div class="label">{{ comboxList.txtLabel[3] }}</div>
								<div class="ipt-flex-message" style="width: 216px">
									<el-input v-model="resultData.crrThck" class="small-ipt  mini-ipt74"
										@input="resultData.crrThck = $setMyNum(resultData.crrThck, '3 - 2')"></el-input>

									<span class="mgl8">[mm]</span>
								</div>
							</div>
							<div class="item">
								<div class="label">Sch</div>
								<el-select v-model="resultData.schCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.schName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row" style="border-bottom: 1px solid #d9d9d9; margin-bottom: 12px">
							<div class="item long-item">
								<div class="label">定点区分</div>
								<div class="check-view-long long-ipt">
									<el-checkbox v-for="(item, index) in 10" :key="index"
										v-if="comboxList[(item < 10 ? 'thkNm0' : 'thkNm') + item]"
										v-model="resultData[(item < 10 ? 'option0' : 'option') + item]"
										:label="comboxList[(item < 10 ? 'thkNm0' : 'thkNm') + item]">
									</el-checkbox>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="item">
								<div class="label">腐食系統</div>
								<el-select v-model="resultData.corLoop" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.corrLoopName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row" v-if="$store.state.macType == 2">
							<div class="item">
								<div class="label">ラインNo.</div>
								<el-select v-model="resultData.macCode" class="ipt " placeholder=" "
									@change="reGetComBox">
									<el-option v-for="(item, index) in comboxList.macName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item long-item">
								<div class="label" style="width: 100%">
									更新時の腐食率計算ルール
								</div>
							</div>
						</div>

						<div class="row" style="border-bottom: 1px solid #d9d9d9; margin-bottom: 12px">
							<div class="item item long-item">
								<div class="label"></div>
								<div class="radio-view"
									style="width: 440px;justify-content: flex-start;padding-left: 24px;">
									<el-radio v-model="resultData.crrType" label="0">更新前の値</el-radio>
									<el-radio v-model="resultData.crrType" label="1">ループ内最大値</el-radio>
									<el-radio v-model="resultData.crrType" label="2">手入力</el-radio>
									<!-- <el-radio v-model="resultData.crrType" label="他">手入力</el-radio> -->
								</div>
								<div class="ipt-flex-message" style="margin-left: 15px">
									<!-- <el-input :value="resultData.crrType != '0' ? '' : resultData.staCrr"
						:disabled="resultData.crrType != '0'" :class="'small-ipt mini-ipt74'"></el-input>
					<span class="mgl8">[mm]</span> -->
									<el-input v-model="resultData.staCrr" class="small-ipt mini-ipt74"
										:class="resultData.crrType == 2 ? 'orange' : ''"
										:disabled="resultData.crrType != 2"
										@input="resultData.staCrr = $setMyNum(resultData.staCrr, '2 - 2') > 99 ? '99.00' : $setMyNum(resultData.staCrr, '2 - 2')"></el-input>
									<span class=" mgl8">[mm/y]</span>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="item">
								<div class="label">測定部位</div>
								<el-select v-model="resultData.posCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.posName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
							<div class="item">
								<div class="label">周期設定係数</div>
								<div class="ipt-flex-message" style="width: 216px;margin-left:15px;">

									<el-input v-model="resultData.lifeCnt" class="small-ipt  mini-ipt74"
										@input="resultData.lifeCnt = $setMyNum(resultData.lifeCnt, '2 - 2')"></el-input>

									<!-- <span class="mgl8">[mm]</span> -->
								</div>
							</div>
						</div>

						<div class="row">
							<div class="item">
								<div class="label">保温保冷</div>
								<el-select v-model="resultData.thkTypCode" class="ipt " placeholder=" ">
									<el-option v-for="item in comboxList.thkTypName" :key="item.key" :label="item.label"
										:value="item.key">
									</el-option>
								</el-select>
							</div>
							<div class="item">
								<div class="label">最長検査周期</div>
								<div class="ipt-flex-message" style="width: 216px;margin-left:15px;">

									<el-input v-model="resultData.lifeMax" class="small-ipt  mini-ipt74"
										@input="resultData.lifeMax = $setMyNum(resultData.lifeMax, '3 - 0')"></el-input>

									<span class="mgl8">[年]</span>
								</div>
							</div>
						</div>

						<div class="row">
							<div class="item">
								<div class="label">足場工事</div>
								<el-select v-model="resultData.icdCstCode" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.icdCstName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
							<div class="item">
								<div class="label">高さ</div>
								<div class="ipt-flex-message" style="width: 216px;margin-left:15px;">

									<el-input v-model="resultData.height" class="small-ipt  mini-ipt74"
										@input="resultData.height = $setMyNum(resultData.height, '5 - 0')"></el-input>

									<span class="mgl8">[mm]</span>
								</div>
							</div>
						</div>

						<div class="row" style="border-bottom: 1px solid #d9d9d9; margin-bottom: 12px">
							<div class="item">
								<div class="label">検査方法</div>
								<el-select v-model="resultData.ispWayType" class="ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.ispMetName" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
							<div class="item">
								<div class="label">フィルム枚数</div>
								<div class="ipt-flex-message" style="width: 216px;margin-left:15px;">

									<el-input v-model="resultData.flmCnt" class="small-ipt  mini-ipt74"
										@input="resultData.flmCnt = $setMyNum(resultData.flmCnt, '2 - 0')"></el-input>

								</div>
							</div>
						</div>

						<div class="row" v-show="$hasOption('OPT_IDEM')">
							<!-- <div> -->
							<div class="row">
								<div class="item item long-item">
									<div class="label" style="min-width: 160px;font-weight: 700;">
										周期設定基準
									</div>
									<div class="radio-view"
										style="width: 490px;justify-content: flex-start;padding-left: 24px;">
										<el-radio v-model="test" label="0">設定値</el-radio>
										<el-radio v-model="test" label="1">最終検査</el-radio>
										<!-- <el-radio v-model="test" label="2">設定しない</el-radio> -->
									</div>
								</div>
							</div>
							<div class="row" style="min-height: 44px;">
								<div class=" item item long-item">
									<div class=" label" style="min-width: 160px;"></div>
									<div class="" style="width: 490px;justify-content: flex-start;">
										<span>点検周期</span>
										<el-input v-model="test" class="small-ipt cetner  mini-ipt74 center orange"
											style="margin: 0 8px;" @input="test = $setMyNum(test, '3 - 0')"></el-input>
										<span>ヶ月</span>
									</div>
								</div>
							</div>
							<div class="row" style="min-height: 44px;">
								<div class="item item long-item" v-show="test == 0">
									<div class="label" style="min-width: 160px;"></div>
									<div class="" style="width: 490px;justify-content: flex-start;">
										<span>基準年月</span>
										<el-date-picker v-model="testDate" class="ipt1 orange" placeholder=" "
											type="month" :clearable="false" :format="format" :value-format="format">
										</el-date-picker>
										<el-checkbox>基準年月も計画年月に含める</el-checkbox>
									</div>
								</div>
							</div>
						</div>

						<div v-show="macType != 1" style="margin-bottom: 12px;padding-top: 12px;"
							:style="{ borderTop: $hasOption('OPT_IDEM') ? '1px solid #d9d9d9' : '' }">
							<div class="row">
								MAT計算
							</div>
							<div class="row">
								<div class="item">
									<div class="label">設計温度</div>
									<div class="ipt-flex-message" style="width: 216px">
										<el-input v-model="resultData.dgnTemp" class="small-ipt mini-ipt74"
											@input="resultData.dgnTemp = $setMyNum(resultData.dgnTemp, '3 - 3')"></el-input>

										<span class="mgl8">[C]</span>
									</div>
								</div>
								<div class="item">
									<div class="label"></div>
									<div class="ipt-flex-message" style="width: 216px;">
										<el-button type="primary" size="mini"
											@click="GetStyleImpDataApi">仕様取込</el-button>
										<el-button type="primary" size="mini" @click="CalcMATFn">計算</el-button>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="item">
									<div class="label">設計圧力</div>
									<div class="ipt-flex-message" style="width: 216px">
										<el-input v-model="resultData.dgnPres" class="small-ipt mini-ipt74"
											@input="resultData.dgnPres = $setMyNum(resultData.dgnPres, '3 - 3')"></el-input>

										<span class="mgl8">[Mpa]</span>
									</div>
								</div>
								<div class="item">
									<div class="label">材質名称</div>
									<el-select v-model="resultData.mtrNamCode" class="ipt " placeholder=" ">
										<el-option v-for="(item, index) in comboxList.matCal" :key="index"
											:label="item.label" :value="item.key">
										</el-option>
									</el-select>
								</div>
							</div>
							<div class="row">
								<div class="item">
									<div class="label">外径</div>
									<div class="ipt-flex-message" style="width: 216px">
										<el-input v-model="resultData.dia" class="small-ipt mini-ipt74"
											@input="resultData.dia = $setMyNum(resultData.dia, '5 - 1')"></el-input>

										<span class="mgl8">[mm]</span>
									</div>
								</div>
								<div class="item">
									<div class="label">継手効率</div>
									<div class="ipt-flex-message" style="width: 216px;">

										<el-input v-model="resultData.dgnFlag" class="small-ipt  mini-ipt74"
											@input="resultData.dgnFlag = $setMyNum(resultData.dgnFlag, '2 - 0')"></el-input>
									</div>
								</div>
							</div>
						</div>

					</div>

					<div v-show="activeBtn == 1">
						<div class="row" style="border-bottom: 1px solid #d9d9d9;margin-bottom: 12px;">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">
									非破壊検査位置
								</div>
								<!-- <el-select v-model="resultData.buiName" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="item in comboxList.buiList" :key="item.key" :label="item.label"
										:value="item.label" allow-create filterable>
									</el-option>
								</el-select> -->

								<el-select v-model="resultData.buiName" class="ipt long-ipt" placeholder=" "
									@input="resultData.buiName = $setMaxLength(resultData.buiName, 60)" allow-create
									filterable>
									<el-option v-for="(item, index) in comboxList.buiList" :key="index"
										:label="item.label" :value="item.vlaue">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">{{ comboxList.factorName01.name }}
								</div>
								<el-select v-model="resultData.f1Code" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.factorName01.dataList" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">{{ comboxList.factorName02.name }}
								</div>
								<el-select v-model="resultData.f2Code" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.factorName02.dataList" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">{{ comboxList.factorName03.name }}
								</div>
								<el-select v-model="resultData.f3Code" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.factorName03.dataList" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">{{ comboxList.factorName04.name }}
								</div>
								<el-select v-model="resultData.f4Code" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.factorName04.dataList" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item item long-item">
								<div class="label" style="min-width: 110px;">{{ comboxList.factorName05.name }}
								</div>
								<el-select v-model="resultData.f5Code" class="ipt long-ipt " placeholder=" ">
									<el-option v-for="(item, index) in comboxList.factorName05.dataList" :key="index"
										:label="item.label" :value="item.key">
									</el-option>
								</el-select>
							</div>
						</div>

						<div class="row">
							<div class="item long-item">
								<div class="label" style="min-width: 110px;">特記事項</div>
								<el-input type="textarea" :rows="4" placeholder=" " v-model="resultData.note"
									class="textarea long-ipt"
									@input="resultData.note = $setMaxLength(resultData.note, 100)"></el-input>
							</div>
						</div>
					</div>

				</div>
			</div>
		</div>

		<TabelShow v-if="LIEF" @hidden="hidden"></TabelShow>
		<STable v-if="LIEF1" :ttgPosOrdr="resultData.ttgPosOrdr" @hidden="hidden" @changettgPosOrdr="changettgPosOrdr">
		</STable>
	</div>
</template>

<script>
import {
	getThckStyleCombox, getThckStyle, getThckPosition,
	getThckStyleTipsMsg, updThckStyleRequiredVerify,
	updThckStyleVerify, updThckStyle, addThckVerify,
	getThckStyleInit, getThckPositionInit, delThckStyle,
	GetStyleImpData, CalcThckStyleMat, GetRequiredMsgByLabel
} from "@/api/api";
import TabelShow from "./TabelShow.vue";
import STable from "./STable.vue";
import { showLoading, hideLoading } from "@/utils/loading";
import _ from 'lodash-es';
import eventBus from "@/eventBus/bus";
import { getLocalStorage } from "../../../../utils/storage";

export default {
	name: "Tab_1",
	props: ["tableItemData", "activeBtn"],

	watch: {
		// tableItemData(nVal) {
		// 	this.getThckStyleComboxApi();
		// },
		//table数据
		tableItemData(nVal) {
			this.chgDateSelectKey = '';

			if (nVal == 'no Data') {
				this.tempTableData = 'no Data'
				this.$emit("DataChangeFn", false);
				this.noDataFlg = true;
				this.$store.state.isStop.name = 'default';
				this.resultData = {};
				this.$store.state.TH_INfo_view1Info = {};
				this.$store.state.TH_INfo_view2Info = [];
				setTimeout(() => {
					this.$store.commit('reSetIsStop');
				}, 300);
			} else {
				this.getThckStyleComboxApi();
			}
		},
		// '$store.state.isStop.name': function (nVal, oVal) {
		// 	//你需要执行的代码
		// 	console.log(nVal, oVal);
		// if (nVal == 'active') {
		// 	this.initFn();
		// }
		// },
		resultData: {
			handler(nVal, oVal) {
				console.log('fsdfsdfsdf   654', !_.isEqual(nVal, this.startData));
				this.$emit("selectChgDateChange", this.chgDateSelectKey);
				if (this.tempTableData == 'no Data') {
					this.$emit("DataChangeFn", false);
					return
				}

				this.$emit("DataChangeFn", !_.isEqual(nVal, this.startData));
			},
			deep: true,
		},
		macNamebValue: {
			deep: true,
			handler: function (newV, oldV) {
				this.$store.state.TH_INfo_view1Info = {};
				this.$store.state.TH_INfo_view2Info = [];
				this.$store.state.TH_INfo_viewComboxList = [];
				this.initType = 2;
				this.delFlg = false;
				this.chgDateSelectKey = '';
				this.resultData = {};
			},
		},
	},
	computed: {
		macNamebValue() {
			return this.$store.state.macNameb;
		},
		btnClickFlg() {
			this.$emit('changeBtnClickFlg', ((this.chgDateSelectKeyDeep != this.chgDateSelectKey) || this.noDataFlg) && this.initType == 2)
			return ((this.chgDateSelectKeyDeep != this.chgDateSelectKey) || this.noDataFlg) && this.initType == 2
		},
		TTP() {
			try {
				return this.comboxList.thckGrp.filter(item => item.code == this.resultData.ttgPosOrdr)[0].ordr
			} catch (error) {
				return ''
			}
		},
		macType() {
			return this.$store.state.macType;
		},
	},

	data() {
		return {
			tempTableData: [],
			test: '0',
			testDate: '',

			format: 'yyyy-MM',
			chgDateSelectKeyDeep: '',
			LIEF: false,
			LIEF1: false,
			noDataFlg: false,
			delFlg: false,
			userData: getLocalStorage('userData'),
			startData: {},
			resultData: {},
			initType: 2,
			input: '',
			value: "",
			radio: "1",
			options: [],
			optionsValue: "",
			textarea: "",
			dateValue: "",
			checkList: [],
			checkListItem: [
				{ key: 0, label: "定点" },
				{ key: 1, label: "移動点" },
				{ key: 2, label: "代表店" },
				{ key: 3, label: "監視点" },
				{ key: 4, label: "テスト5" },
				{ key: 5, label: "##" },
				{ key: 6, label: "###" },
				{ key: 7, label: "###" },
				{ key: 8, label: "###" },
				{ key: 9, label: "#####" },
			],

			chgDateSelectKey: "",
			// 下拉数据
			comboxList: {
				chgDate: [], // 1.建设年月
				mtrClsName: [], // 2.材质分类
				sizeName: [], // 3.サイズ Size
				schName: [], // 4.Sch
				corrLoopName: [], // 5.腐食ループ

				macName: [], // 6.ラインNo
				posName: [], // 7.測定部位
				thkTypName: [], // 8.保温保冷
				icdCstName: [], // 9.足場工事
				ispMetName: [], // 10.検査方法

				factorName01: {}, // 11.関連因子タイトル 点击选择后弹出的页面数据 01
				factorName02: {}, // 12.関連因子タイトル 点击选择后弹出的页面数据 02
				factorName03: {}, // 13.関連因子タイトル 点击选择后弹出的页面数据 03
				factorName04: {}, // 14.関連因子タイトル 点击选择后弹出的页面数据 04
				factorName05: {}, // 15.関連因子タイトル 点击选择后弹出的页面数据 05
				buiList: [],

				thkNm01: "", // 16.定点区分1
				thkNm02: "", // 17.定点区分2
				thkNm03: "", // 18.定点区分3
				thkNm04: "", // 19.定点区分4
				thkNm05: "", // 20.定点区分5
				thkNm06: "", // 21.定点区分6
				thkNm07: "", // 22.定点区分7
				thkNm08: "", // 23.定点区分8
				thkNm09: "", // 24.定点区分9
				thkNm10: "", // 25.定点区分10
				thkOption: "", // 定点区分all

				factorLabel01: [], // 26.関連因子タイトル 1 页面上的标题
				factorLabel02: [], // 27.関連因子タイトル 2 页面上的标题
				factorLabel03: [], // 28.関連因子タイトル 3 页面上的标题
				factorLabel04: [], // 29.関連因子タイトル 4 页面上的标题
				factorLabel05: [], // 30.関連因子タイトル 5 页面上的标题

				thckGrp: [], // 32-33.グループNo
				txtLabel: [],
				matCal: [],
				thckOpe: []
			},
			timeFormat: "yyyy-MM-dd",
			test0: false,
			// chgDate: []
		};
	},
	components: { TabelShow, STable },
	methods: {

		FILTERFn() {
			eventBus.$emit('getBasicStyleCompontensCurrent_EventBus');	//	基本仕样
			let Fn = () => {
				this.LIEF = true;
			}

			if (this.$store.state.isCurrentNext) {
				Fn();
			} else {
				/**
				  * 4-1。   记录原来该运行的函数。
				  * 4-2。   执行保存弹出框操作。   
				  */
				this.$store.commit("changeIsCurrentFn", Fn);

				eventBus.$emit('EventBusBasicStyleCompontensSaveFn');	//	基本仕样
			}
		},
		changettgPosOrdr(e) {
			console.log(e, 'EEEEEe');
			this.resultData.ttgPosOrdr = e;
		},
		async hidden() {
			this.LIEF = false;
			this.LIEF1 = false;
			let res = await getThckStyleCombox({
				dmgCode: this.$store.state.macCode,
				MacCode: Number(this.$store.state.realMacCode),
				posNo: Number(this.tableItemData.POS_NO) || 0,
				macType: this.$store.state.macType,
			})
			this.comboxList = res.data.data;
		},
		async reGetComBox(e) {
			let res = await getThckStyleCombox({
				dmgCode: this.$store.state.macCode,
				MacCode: Number(e),
				posNo: Number(this.tableItemData.POS_NO) || 0,
				macType: this.$store.state.macType,
			})
			this.comboxListcorrLoopName = res.data.datacorrLoopName;
		},
		//削除
		async delThckStyleApi() {
			this.delFlg = true;
			let tip = await this.getThckStyleTipsMsgApi(2, false);
			this.$confirm(tip, '', {
				confirmButtonText: 'OK',
				cancelButtonText: 'Cancel',
				type: 'warning'
			}).then(async () => {
				let dataJosn = {
					AddType: false,//	是	bool	追加标识 如果是点击了追加后 按削除，这个值就是true，反之为false
					TtpPosOrdr: this.tableItemData.POS_ORDR.toString(),//	是	string	定点番号
					TtpPosNo: Number(this.tableItemData.POS_NO).toString(),//	是	string	定点番号
					DmgCode: this.$store.state.macCode,
				}
				let res = await delThckStyle(dataJosn);
				if (res.data.code != 0) {
					this.$message({
						type: 'error',
						message: res.data.msg
					});
				}
				eventBus.$emit('LoadTabelData', false);
				console.log(res);
				this.$message({
					type: 'success',
					message: res.data.msg
				});
				this.getThckStyleApi();
				this.delFlg = false;
			}).catch(() => {

				this.delFlg = false;
			});
		},
		//追加
		async ADD(flg = false) {
			//初始监听状态
			if (flg) {
				eventBus.$emit('getBasicStyleCompontensCurrent_EventBus');	//	基本仕样
			}
			let Fn = () => {
				let qq = "ssqcop";
				let dataJson = {
					Type: 1,//是	int	1=肉厚仕样 2=方位
					DmgCode: this.$store.state.macCode,//是	string	设备编号
					CodOrdr: 1,//是	int	方位列表中的最大表示順位+1
				}
				addThckVerify(dataJson).then(res => {
					if (res.data.code == 0) {
						this.$alert(res.data.msg, '', {
							confirmButtonText: 'OK',
							type: 'warning',
							callback: action => { }
						});
						return
					}
				});

				this.initType = 1;
				this.getThckStyleComboxApi(false);
				this.getThckStyleInitApi();
				this.getThckPositionInitApi();
			}
			/**
			 * 2。  记录当前函数。
			 */
			if (this.$store.state.isCurrentNext) {
				Fn();
			} else {
				/**
				  * 4-1。   记录原来该运行的函数。
				  * 4-2。   执行保存弹出框操作。   
				  */
				this.$store.commit("changeIsCurrentFn", Fn);

				eventBus.$emit('EventBusBasicStyleCompontensSaveFn');	//	基本仕样
			}

		},
		//保存
		async initFn(isSaveBtn) {

			// this.$store.state.isStop.name = 'default';
			// 		验证以下Lab：
			//   定点名称 3
			//   定点No 2
			//   建設年月 1
			//   元肉厚 9
			//   管理値 10
			//   如果设备类型选择的是配管则验证多加以下的Lab：
			//   ラインNo 18

			//1.获取保存提示
			let msg = await this.getThckStyleTipsMsgApi();
			this.$confirm(msg, '', {
				confirmButtonText: 'OK',
				cancelButtonText: 'Cancel',
				type: 'warning'
			}).then(async () => {
				this.$emit('isConfirmingFn', false);
				if (this.resultData.posName == '') {
					let getMsgJson = { label: '定点名称' }
					let reqMSG = await GetRequiredMsgByLabel(getMsgJson);
					this.$alert(reqMSG.data.data, {
						confirmButtonText: 'OK',
						type: 'warning',
					});
					//  导航条误
					eventBus.$emit('isNavChangeErrorFn');
					//  搜索框索引误
					eventBus.$emit('backParamsForLeftView');
					return
				}
				this.saveFn(isSaveBtn);
			}).catch(() => {
				this.$emit('isConfirmingFn', false);

				try {
					var tempFn = null;
					tempFn = this.$store.state.isCurrentFn.toString();
				} catch (error) {
					//
				}

				if (isSaveBtn) {
					return
				}
				this.$store.state.isCurrentNext = true;
				eventBus.$emit('LoadTabelData', true);
				this.getThckStyleApi();
				if (tempFn.indexOf('ssqcop') != -1) {
					setTimeout(() => {
						this.$store.state.isCurrentFn();
						this.$store.commit("reSetIsCurrent");
					}, 2000);
				} else {
					this.$store.state.isCurrentFn();
					this.$store.commit("reSetIsCurrent");
				}
			});

		},
		async saveFn(isSaveBtn) {
			showLoading()
			const requiredFields = [
				{ title: '建設年月', value: this.chgDateSelectKey },
				{ title: '定点名称', value: this.resultData.ttpPosOrdr },
				{ title: '定点No', value: this.resultData.ttpPosOrdr },
				{ title: '元肉厚', value: this.resultData.orgThck },
				{ title: '管理値', value: this.resultData.mgtThck },
				{ title: 'ラインNo', value: this.resultData.macCode }
			];

			// 1. 验证必填项
			let missingFields = requiredFields.filter(field => !field.value);

			// if (this.resultData.crrType == 2 && !this.resultData.staCrr) {
			// 	missingFields = [{ title: '更新時の腐食率計算ルール' }];
			// }
			if (missingFields.length > 0) {
				const msg = await this.updThckStyleRequiredVerifyApi(missingFields[0].title);
				this.$alert(msg, '', { confirmButtonText: 'OK', type: 'warning', });
				hideLoading();
				return;
			}

			// 2. 更新前验证
			const updRes = await this.updThckStyleVerifyApi();
			if (updRes.data.code === 0) {
				this.$alert(updRes.data.msg, '', { confirmButtonText: 'OK', type: 'warning', });
				hideLoading();
				return;
			}

			// 3. 弹出确认框
			if (updRes.data.code === 451) {
				hideLoading();
				const result = await this.$confirm(updRes.data.msg, '', {
					confirmButtonText: 'OK',
					cancelButtonText: 'Cancel',
					type: 'warning'
				});
				if (!result) return;
			}

			// 4. 调用更新接口
			const upRes = await this.updThckStyleApi();
			hideLoading()
			if (upRes.data.code !== 0) {
				//  导航条误
				eventBus.$emit('isNavChangeErrorFn');
				//  搜索框索引误
				eventBus.$emit('backParamsForLeftView');

				this.$alert(upRes.data.msg, '', {
					confirmButtonText: 'OK',
					type: 'warning',
				});

				return;
			}

			try {
				var tempFn = null;
				tempFn = this.$store.state.isCurrentFn.toString();
			} catch (error) {
				//
			}

			this.$message.success(upRes.data.msg);
			this.$store.state.threeFlg = this.resultData.ttpPosOrdr;


			/**
			 * new
			 */
			//	刷新？
			this.$store.state.isCurrentNext = true;
			eventBus.$emit('LoadTabelData', true);
			this.getThckStyleApi();
			//	追加？
			if (tempFn.indexOf('ssqcop') != -1) {
				setTimeout(() => {
					this.ADD();
				}, 2000);
			}
			//	跳转？
			else if (!isSaveBtn) {
				this.$store.state.isCurrentFn()
				this.$store.commit("reSetIsCurrent");
			}
			return

			if (isSaveBtn) {
				eventBus.$emit('LoadTabelData', true);
				this.getThckStyleApi();
				return
			}
			if (tempFn.indexOf('ssqcop') != -1) {
				eventBus.$emit('LoadTabelData', true);
			}
			setTimeout(() => {
				//	追加
				if (tempFn.indexOf('ssqcop') != -1) {
					this.$store.state.isCurrentNext = true;
					this.ADD();
					return
				}
				this.getThckStyleApi();
				this.$store.state.isCurrentFn()

				this.$store.commit("reSetIsCurrent");

				eventBus.$emit('LoadTabelData', true);
			}, 2000);
		},
		//1获取 肉厚仕样 提示信息 1 削除和更新都用这个 接口2
		async getThckStyleTipsMsgApi(type = 1, addType = false) {
			let dataJosn = {
				type,
				ttpPosOrdr: this.resultData.ttpPosOrdr,
				addType,
			};
			let res = await getThckStyleTipsMsg(dataJosn);
			return res.data.msg
		},
		//2必填项的验证
		async updThckStyleRequiredVerifyApi(lab) {
			let dataJosn = {
				lab
			};
			let res = await updThckStyleRequiredVerify(dataJosn);
			return res.data.msg
		},
		//3.更新前验证
		getDataJson() {

			let view2DataJson = this.$store.state.TH_INfo_view2Info;
			let ThckPositionLst = [];
			view2DataJson.forEach(item => {
				ThckPositionLst.push(
					{
						PosOrdr: item.posOrdr,//是	int	PosOrdr
						PosName: this.resultData.ttpPosOrdr ? this.resultData.ttpPosOrdr.toString() : '',//是	string	PosName
						CodOrdr: Number(item.codOrdr),//是	int	表示順
						MsrPnt: item.msrPnt,//是	string	方位名称
						PosNo: item.posNo,//是	int	PosNo
						RevNo: item.revNo,//是	int	RevNo
						ClsType: item.clsType,//是	int	ClsType
					}
				)
			});

			let dataJosn = {
				PltCode: Number(this.$store.state.pltCode),//是	int	装置ID
				DmgCode: this.$store.state.macCode,//是	int	设备编号
				ThckStyleType: this.initType,//是	int	肉厚仕样类型 1=追加 2=更新
				PositionType: this.initType,//是	int	肉厚方位类型 1=追加 2=更新
				ChgDate: this.chgDateSelectKey,//是	string	建设年月 1
				BuiName: this.resultData.buiName,
				PosOrdr: Number(this.resultData.ttpPosOrdr),//是	int	位置順 2
				OldPosOrdr: Number(this.resultData.OldPosOrdr),//是	int	原始位置順
				PosName: this.resultData.posName ? this.resultData.posName.toString() : '',//是	string	定点名称 3
				UseCase: this.resultData.useCase ? this.resultData.useCase.toString() : '',//是	string	利用状況 運用中：1、休止中：2 4
				GrnPosNo: Number(this.resultData.ttgPosOrdr),//是	int	グループ番号 没有输入: this.resultData.posCode则,//是0 5
				OrgThck: this.resultData.orgThck ? this.resultData.orgThck.toString() : '',//是	string	元肉厚 9
				MgtThck: this.resultData.mgtThck ? this.resultData.mgtThck.toString() : '',//是	string	管理値 10
				LmtThck: this.resultData.lmtThck ? this.resultData.lmtThck.toString() : '',//是	string	限界値 11
				CrrThck: this.resultData.crrThck ? this.resultData.crrThck.toString() : '',//是	string	腐れ代 12
				MtrClsCode: this.resultData.mtrClsCode ? this.resultData.mtrClsCode.toString() : '',//是	string	材質 13
				MtrName: this.resultData.mtrName ? this.resultData.mtrName.toString() : '',//是	string	材質名称 14
				SizCode: this.resultData.sizCode ? this.resultData.sizCode.toString() : '',//是	string	サイズ 15
				SchCode: this.resultData.schCode ? this.resultData.schCode.toString() : '',//是	string	Ｓｃｈ 16
				CorLoop: this.resultData.corLoop ? this.resultData.corLoop.toString() : '',//是	string	CL番号 17
				// CorLoop: '0',//是	string	CL番号 17
				MacCode: this.resultData.macCode ? this.resultData.macCode.toString() : '',//是	string	機器コード 18
				CrrType: Number(this.resultData.crrType) == 0 ? 0 : Number(this.resultData.crrType) || -1,//是	int	更新直後の腐食率の適用ルール 更新前の値:0、ループ内最大値:1、手入力:2 19
				StaCrr: this.resultData.staCrr ? this.resultData.staCrr.toString() : '',//是	string	手入力 20
				PosCode: Number(this.resultData.posCode),//是	int	測定部位 21
				ThkTypCode: Number(this.resultData.thkTypCode),//是	int	保温保冷 22
				IcdCstCode: Number(this.resultData.icdCstCode),//是	int	足場工事 23
				IspWayType: Number(this.resultData.ispWayType),//是	int	検査方法 24
				LifeCnt: this.resultData.lifeCnt ? this.resultData.lifeCnt.toString() : '',//是	string	周期設定係数 25
				LifeMax: this.resultData.lifeMax ? this.resultData.lifeMax.toString() : '',//是	string	最長検査周期 26
				Height: this.resultData.height ? this.resultData.height.toString() : '',//是	string	高さ 27
				FlmCnt: this.resultData.flmCnt ? this.resultData.flmCnt.toString() : '',//是	string	ﾌｨﾙﾑ枚数 28
				Option01: this.resultData.option01 ? '1' : '0',//是	string	自主保安 29
				Option02: this.resultData.option02 ? '1' : '0',//是	string	監視点 30
				Option03: this.resultData.option03 ? '1' : '0',//是	string	移動点 31
				Option04: this.resultData.option04 ? '1' : '0',//是	string	非定例 32
				Option05: this.resultData.option05 ? '1' : '0',//是	string	定点 33
				Option06: this.resultData.option06 ? '1' : '0',//是	string	機器ノズル 34
				Option07: this.resultData.option07 ? '1' : '0',//是	string	スタンドパイプ 35
				Option08: this.resultData.option08 ? '1' : '0',//是	string	ｵﾌﾟｼｮﾝﾌﾗｸﾞ08 36
				Option09: this.resultData.option09 ? '1' : '0',//是	string	ｵﾌﾟｼｮﾝﾌﾗｸﾞ09 37
				Option10: this.resultData.option10 ? '1' : '0',//是	string	ｵﾌﾟｼｮﾝﾌﾗｸﾞ10 38
				// Search01: this.resultData.f1Name ? this.resultData.f1Name.toString() : '',//是	string	検索用ワード01 39
				// Search02: this.resultData.f2Name ? this.resultData.f2Name.toString() : '',//是	string	検索用ワード02 40
				// Search03: this.resultData.f3Name ? this.resultData.f3Name.toString() : '',//是	string	検索用ワード03 41
				// Search04: this.resultData.f4Name ? this.resultData.f4Name.toString() : '',//是	string	検索用ワード04 42
				// Search05: this.resultData.f5Name ? this.resultData.f5Name.toString() : '',//是	string	検索用ワード05 43

				Search01: this.resultData.f1Code ? this.resultData.f1Code.toString() : '',//是	string	検索用ワード01 39
				Search02: this.resultData.f2Code ? this.resultData.f2Code.toString() : '',//是	string	検索用ワード01 39
				Search03: this.resultData.f3Code ? this.resultData.f3Code.toString() : '',//是	string	検索用ワード01 39
				Search04: this.resultData.f4Code ? this.resultData.f4Code.toString() : '',//是	string	検索用ワード01 39
				Search05: this.resultData.f5Code ? this.resultData.f5Code.toString() : '',//是	string	検索用ワード01 39


				Note: this.resultData.note ? this.resultData.note.toString() : '',//是	string	特記事項 44
				UpdUser: getLocalStorage('userName'),//是	string	更新者

				PosNo: Number(this.resultData.posNo),//是	int	位置No 54
				RevNo: Number(this.resultData.revNo),//是	int	リビジョンNo 55

				DgnTemp: this.resultData.dgnTemp,
				DgnPres: this.resultData.dgnPres,
				MtrNamCode: Number(this.resultData.mtrNamCode),
				Dia: this.resultData.dia,
				DgnFlag: this.resultData.dgnFlag,
				ThkOpeCode: Number(this.resultData.thkOpeCode),

				ThckPositionLst//是	List<T>	方位信息 集合
			};
			return dataJosn;
		},
		async updThckStyleVerifyApi() {
			let res = await updThckStyleVerify(this.getDataJson());
			return res;
		},
		//4调用更新
		async updThckStyleApi() {
			let res = await updThckStyle(this.getDataJson());
			hideLoading();
			return res;
		},

		//追加1接口8 addThckVerify
		async addThckVerifyApi() {
			let dataJson = {
				Type: 1,//是	int	1=肉厚仕样 2=方位
				DmgCode: this.$store.state.macCode,//是	string	设备编号
				CodOrdr: 1,//是	int	方位列表中的最大表示順位+1
			}
			let res = await addThckVerify(dataJson);
			return res
		},
		//初始化追加数据6-7
		async getThckStyleInitApi() {
			this.resultData = [];
			let dataJson = {
				DmgCode: this.$store.state.macCode,
				PltCode: Number(this.$store.state.pltCode),
			}
			let res = await getThckStyleInit(dataJson);
			this.resultData = res.data.data;
			this.chgDateSelectKey = this.resultData.chgDate;
			this.resultData.corLoop = this.resultData.corLoop.toString();
			this.resultData.f1Code = this.resultData.f1Code.toString();
			this.resultData.f2Code = this.resultData.f2Code.toString();
			this.resultData.f3Code = this.resultData.f3Code.toString();
			this.resultData.f4Code = this.resultData.f4Code.toString();
			this.resultData.f5Code = this.resultData.f5Code.toString();
			this.resultData.option01 = this.resultData.option01 == 1 ? true : false;
			this.resultData.option02 = this.resultData.option02 == 1 ? true : false;
			this.resultData.option03 = this.resultData.option03 == 1 ? true : false;
			this.resultData.option04 = this.resultData.option04 == 1 ? true : false;
			this.resultData.option05 = this.resultData.option05 == 1 ? true : false;
			this.resultData.option06 = this.resultData.option06 == 1 ? true : false;
			this.resultData.option07 = this.resultData.option07 == 1 ? true : false;
			this.resultData.option08 = this.resultData.option08 == 1 ? true : false;
			this.resultData.option09 = this.resultData.option09 == 1 ? true : false;
			this.resultData.option10 = this.resultData.option10 == 1 ? true : false;

			this.resultData.f1Code = this.comboxList.factorName01.dataList[0].key;
			this.resultData.f2Code = this.comboxList.factorName02.dataList[0].key;
			this.resultData.f3Code = this.comboxList.factorName03.dataList[0].key;
			this.resultData.f4Code = this.comboxList.factorName04.dataList[0].key;
			this.resultData.f5Code = this.comboxList.factorName05.dataList[0].key;

			this.resultData.OldPosOrdr = this.resultData.ttpPosOrdr;
			this.resultData.initType = 1;

			this.$store.state.TH_INfo_view1Info = this.resultData;
			console.log(res);
		},
		async getThckPositionInitApi() {
			let dataJson = {
				dmgCode: this.$store.state.macCode,
				posNo: Number(this.tableItemData.POS_NO) || 0,
				chgDate: this.chgDateSelectKey,
			}
			let res = await getThckPositionInit(dataJson);
			// this.$store.state.TH_INfo_view2Info = [res.data.data];
			eventBus.$emit('clearTwo', [res.data.data])

			console.log(res);
		},

		//更改日期重新获取数据
		selectChgDateOption(e) {
			//由于是根据日期加载数据，所以切换日期=》不重新加载下拉框
			this.getThckStyleApi(false);
		},

		// 获取下拉表格=》获取数据=>是否只加载下来框
		getThckStyleComboxApi(flg = true) {
			this.resultData = {};
			return getThckStyleCombox({
				dmgCode: this.$store.state.macCode,
				MacCode: this.$store.state.realMacCode,
				posNo: Number(this.tableItemData.POS_NO) || 0,
				macType: this.$store.state.macType,
			}).then((res) => {
				if (res.data.code != 0) {
					return;
				}

				for (let key in this.comboxList) {
					this.comboxList[key] = res.data.data[key];
				}
				if (this.initType == 2) { // 非追加状态下，获取数据默认日期的第一个，追加有追加的日期
					if (res.data.data.chgDate.length != 0) {
						this.chgDateSelectKey = res.data.data.chgDate[0].label;
						this.chgDateSelectKeyDeep = res.data.data.chgDate[0].label;
					} else {
						this.chgDateSelectKey = '';
						this.noDataFlg = true;
					}
				}


				this.$store.state.TH_INfo_viewComboxList = this.comboxList;

				if (flg) {
					setTimeout(() => {
						this.getThckStyleApi();
					}, 300);
				}
			});
		},
		// 获取MAT计算
		async GetStyleImpDataApi() {
			let D = {
				MacCode: Number(this.$store.state.realMacCode),
			};
			let R = await GetStyleImpData(D);
			if (R.data.code != 0) {
				this.$alert(R.data.msg, '', {
					confirmButtonText: 'OK',
					type: 'warning',
				});
				return
			}
			this.$message.success(R.data.msg);
			this.resultData.dgnTemp = R.data.data.dgnTemp;
			this.resultData.dgnPres = R.data.data.dgnPres;
		},
		// MAT计算按钮
		async CalcMATFn() {
			let D = {
				Temp: this.resultData.dgnTemp,
				Pres: this.resultData.dgnPres,
				Dia: this.resultData.dia,
				MtrCode: Number(this.resultData.mtrNamCode),
				EffRate: this.resultData.dgnFlag,
			};
			let R = await CalcThckStyleMat(D);
			if (R.data.code != 0) {
				this.$alert(R.data.msg, '', {
					confirmButtonText: 'OK',
					type: 'warning',
				});
				return
			}
			this.$message.success(R.data.msg);
			this.resultData.lmtThck = R.data.data;
		},
		//获取数据=》view1
		async getThckStyleApi(Flag = true) {
			this.$emit('DataChangeFn', false);
			this.initType = 2;
			this.$emit("selectChgDateChange", '');
			let res = await getThckStyle({
				dmgCode: this.$store.state.macCode,
				posNo: Number(this.tableItemData.POS_NO) || 0,
				chgDate: this.chgDateSelectKey,
				Flag,
			})

			console.log("getThckStyleApi", res);
			if (res.data.code == 0 && res.data.data.length > 0) {
				this.noDataFlg = false;

				this.resultData = res.data.data[0];
				// for (const key in this.resultData) {
				// 	if (this.resultData[key] != null) {
				// 		this.resultData[key] = this.resultData[key].toString().trim();
				// 	}
				// }

				this.resultData.crrThck = this.resultData.crrThck ? this.resultData.crrThck : '';
				this.resultData.corLoop = this.resultData.corLoop.toString();
				this.resultData.f1Code = this.resultData.f1Code.toString();
				this.resultData.f2Code = this.resultData.f2Code.toString();
				this.resultData.f3Code = this.resultData.f3Code.toString();
				this.resultData.f4Code = this.resultData.f4Code.toString();
				this.resultData.f5Code = this.resultData.f5Code.toString();
				this.resultData.thkOpeCode = this.resultData.thkOpeCode.toString();
				this.resultData.mtrNamCode = this.resultData.mtrNamCode.toString();
				this.resultData.option01 = this.resultData.option01 == 1 ? true : false;
				this.resultData.option02 = this.resultData.option02 == 1 ? true : false;
				this.resultData.option03 = this.resultData.option03 == 1 ? true : false;
				this.resultData.option04 = this.resultData.option04 == 1 ? true : false;
				this.resultData.option05 = this.resultData.option05 == 1 ? true : false;
				this.resultData.option06 = this.resultData.option06 == 1 ? true : false;
				this.resultData.option07 = this.resultData.option07 == 1 ? true : false;
				this.resultData.option08 = this.resultData.option08 == 1 ? true : false;
				this.resultData.option09 = this.resultData.option09 == 1 ? true : false;
				this.resultData.option10 = this.resultData.option10 == 1 ? true : false;
				this.resultData.OldPosOrdr = this.resultData.ttpPosOrdr;

				this.startData = _.cloneDeep(this.resultData);

				this.$store.state.TH_INfo_view1Info = this.resultData;
				this.getThckPositionApi();
				return
			}
			if (res.data.code == -300) {
				this.noDataFlg = true;
				Object.keys(this.resultData).forEach(key => {
					this.resultData[key] = ''
				})
				setTimeout(() => {
					this.$emit("selectChgDateChange", '');
				}, 300);

				this.startData = _.cloneDeep(this.resultData);

				this.$store.state.TH_INfo_view1Info = this.resultData;
				this.getThckPositionApi();
				return
			}
			this.$message({
				type: 'error',
				message: res.data.msg
			})

			this.getThckPositionApi();
		},
		//获取数据=》view2
		async getThckPositionApi() {
			this.$emit('DataChangeFn', false);
			return getThckPosition({
				dmgCode: this.$store.state.macCode,
				posNo: Number(this.tableItemData.POS_NO) || 0,
				chgDate: this.chgDateSelectKey,
			}).then((res) => {
				console.log("getThckPositionApi", res);
				if (res.data.data) {
					res.data.data.sort((a, b) => {
						return a.codOrdr - b.codOrdr;
					})
					this.$store.state.TH_INfo_view2Info = res.data.data;
					// 获取到数据加载高亮
					// this.$refs.singleTable.setCurrentRow(this.prposTabelData[this.nowIndexPrpo]);
				} else {
					this.$store.state.TH_INfo_view2Info = [];
				}
			});
		},

		dateChange(val) {
			console.log(`dateChange(${this.dateValue})`);
			console.log(val);
			// this.getResOfferEjectDataApi();
		},

	},
	created() { },
	mounted() {


		this.chgDateSelectKey = this.$store.state.TH_INfo_view1Info.chgDateSelectKey;
		if (this.$store.state.TH_INfo_view1Info.initType == 1) {
			this.initType = 1
		}
		if (Object.keys(this.$store.state.TH_INfo_view1Info).length <= 1) {
			this.getThckStyleComboxApi();
		} else {
			this.resultData = this.$store.state.TH_INfo_view1Info;
			this.comboxList = this.$store.state.TH_INfo_viewComboxList;
			if (this.comboxList.chgDate.length != 0) {
				this.chgDateSelectKey = this.comboxList.chgDate[0].label;
			}
			this.startData = _.cloneDeep(this.resultData);
		}

		eventBus.$on('reGetBHTab1Data', () => {
			this.getThckStyleComboxApi();
		})
	},
	beforeDestroy() {
		eventBus.$off('reGetBHTab1Data');
		this.$store.state.TH_INfo_view1Info.chgDateSelectKey = this.chgDateSelectKey;
	},
	destroyed() { },
};
</script>
<style lang="scss" scoped>
.tabs-cps-view {
	width: 100%;

	.row {
		display: flex;
		justify-content: space-between;
		padding-bottom: 12px;

		.item {
			width: 48%;
			display: flex;
			justify-content: flex-start;

			.label {
				min-width: 85px;
				max-width: 85px;
				display: flex;
				align-items: center;
			}

			.strat-view {
				width: calc(100% - 89px);
				display: flex;
				align-items: center;
				justify-content: space-between;
			}
		}

		.long-item {
			width: 100%;

			.long-ipt {
				width: calc(100% - 89px);

				::v-deep .el-input__inner {
					width: 100%;
					height: 32px;
				}
			}
		}
	}
}

.radio-view {
	width: 238px;
	height: 32px;
	border-radius: 4px;
	border: 1px solid #d9d9d9;
	display: flex;
	align-items: center;
	justify-content: center;
}

.radio-view-long {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	height: 32px;
	border-radius: 4px;
	border: 1px solid #d9d9d9;
	padding: 0 16px;
}

.check-view-long {
	display: flex;
	// align-items: center;
	justify-content: flex-start;
	// height: 68px;
	border-radius: 4px;
	flex-wrap: wrap;
	border: 1px solid #d9d9d9;
	padding: 8px 16px;

	::v-deep .el-checkbox {
		height: 20px;
		width: 12%;
	}
}

.ipt-flex-view {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 32px;
}

.ipt-flex-message {
	display: flex;
	align-items: center;
}

.ipt {
	width: 238px;
	height: 32px;

	::v-deep .el-input__inner {
		width: 238px;
		height: 32px;
	}

	::v-deep .el-input__inner:focus {
		border: 1px solid #dcdfe6;
	}

	::v-deep .el-input__icon {
		line-height: 32px;
		color: #909399;
	}

	::v-deep .el-input__suffix {
		width: 32px;
		right: 0;
		background: #dee0e3;
	}
}

.ipt1 {
	width: 155px;
	height: 32px;
	margin: 0 8px;

	::v-deep .el-input__inner {
		width: 155px;
		height: 32px;
	}

	::v-deep .el-input__inner:focus {
		border: 1px solid #dcdfe6;
	}

	::v-deep .el-input__icon {
		line-height: 32px;
		color: #909399;
	}
}

.small-ipt {
	width: 180px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
	}
}

.center {
	::v-deep .el-input__inner {
		text-align: center !important;
	}
}

.mini-ipt {
	width: 48px;
	min-width: 48px;
	max-width: 48px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		padding: 0;
		text-align: center;
	}
}

.small-ipt148 {
	width: 148px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
	}
}

.long-ipt518 {
	width: 518px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
	}
}

.mini-ipt116 {
	width: 116px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
	}
}

.mini-ipt74 {
	width: 94px;
	min-width: 94px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		text-align: right;
	}
}

.mini-ipt77 {
	width: 115px;
	min-width: 115px;

	::v-deep .el-input__inner {
		width: 100%;
		height: 32px;
		text-align: left;
		padding: 0 0 0 5px;
	}
}


.flex-ipt-view {
	width: 238px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.picker {
	width: 130px;

	::v-deep .el-input__inner {
		width: 130px;
	}

	::v-deep .el-input__suffix {
		background: transparent;
	}
}

.orange {
	::v-deep .el-input__inner {
		background: #ffdeac;
	}
}

.yellow {
	::v-deep .el-input__inner {
		background: #ffffe1;
	}
}

.disabled-color {
	::v-deep .el-input__inner {
		background: #f5f6f7;
	}
}

.textarea {
	::v-deep .el-textarea__inner {
		resize: none;
		// background: #ffffe1;
	}
}

.mgl8 {
	margin-left: 8px;
}

.mgr8 {
	margin-right: 8px;
}

.mgl16 {
	margin-left: 16px;
}

.btn-basic {
	width: 272px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: #106ebe;
	border-radius: 4px;
}

.btn-basic-two {
	width: 272px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.small-btn {
	width: 128px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: #106ebe;
	border-radius: 4px;
}

.date-ipt {
	::v-deep .el-input__suffix {
		background: transparent;
	}
}

.transparent-btn {
	padding: 0 14px;
	border-radius: 4px;
	height: 32px;
	border: 1px solid #d3d3d3;
	display: flex;
	justify-content: center;
	align-items: center;
	color: rgba(0, 0, 0, 0.65);
}

.add-view {
	width: 100%;
	padding-bottom: 12px;
	border-bottom: 1px solid #d9d9d9;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;

	button {
		// width: 68px;
		// height: 32px;
		// background: #ffffff;
		// border: 1px solid #d9d9d9;
		margin-left: 12px;
		border-radius: 4px;
	}
}
</style>
